class CategoryController < ApplicationController
  def index
    @categories = ItemCategory.active
  end
  
  def show
    @category = ItemCategory.active.find(params[:id])
    @order = params[:order] = params[:order].blank? ? 'global_rating' : params[:order]
    @items = @category.cat1_items.paginate :page => params[:page], :per_page => 16, :order => @order
  end
  
  def cat2
    @category = ItemCategory.active.find(params[:id])
    @order = params[:order] = params[:order].blank? ? 'global_rating' : params[:order]
    @items = @category.cat2_items.paginate :page => params[:page], :per_page => 16, :order => @order
  end
end
